import { Controller, Get, Request } from '@nestjs/common';
import { AdminService } from './admin.service';
import { ApiOperation, ApiTags } from '@nestjs/swagger';
import { CURRENT_USER } from 'src/core/contants';

@ApiTags('管理员模块')
@Controller('admin')
export class AdminController {
  constructor(private adminService: AdminService) {}

  @Get('info')
  @ApiOperation({ summary: '获取管理员信息' })
  async getAdminInfo(@Request() req) {
    return await this.adminService.findOne(req[CURRENT_USER].uid);
  }
}
